import Home from "@/views/Home";
import Login from "@/views/Login";
import Register from "@/views/Register";
import Search from "@/views/Search";
import Detail from "@/views/Detail";
import AddCartSuccess from "@/views/AddCartSuccess"
import ShopCart from "@/views/ShopCart"
import Center from "@/views/Center"
import Trade from "@/views/Trade"
import Pay from '@/views/Pay'
import PaySuccess from "@/views/PaySuccess"

export default [
    {
        path: "/home",
        component: Home,
        meta: { show: true },
    },
    {
        path: "/login",
        component: Login,
        meta: { show: false },
    },
    {
        path: "/register",
        component: Register,
        meta: { show: false },
    },
    {
        path: "/search/:keyword?",
        component: Search,
        meta: { show: true },
        name: "search",
    },
    {
        path: "/detail/:skuid",
        component: Detail,
        meta: { show: true },
        name: "detail",
    },
    {
        //添加到购物车成功
        path:"/cart/addtocart/:skuId?/:skuNum?",
        component:AddCartSuccess,
        name:"addcartsuccess",
        meta:{show :true},
    },
    {
        //购物车模块
        path:"/shopcart",
        component:ShopCart,
        name:"shopcart",
        meta:{show :true},
    },
    {
        //我的订单页面
        path:"/center",
        component:Center,
        name:"center",
        meta:{show:true},
    },
    {
        //下订单页面
        path:"/trade",
        component:Trade,
        name:"trade",
        meta : {show:true},
    },
    {
        // 结算页面
        path:"/pay",
        component: Pay,
        name:"pay",
        meta:{show:true}
    },
    {
        // 支付成功页面
        path:"/paysuccess",
        component: PaySuccess,
        name:"paysuccess",
        meta:{show:true}
    },
    //重定向，在项目跑起来的时候，访问/，立马让他定向到首页
    { 
        path: '/', redirect: '/home',
    },
];
